* gtk/gtktextlayout.c: Fix a warning.
* gtk/gtktextsegment.h:
* gtk/gtktextsegment.c:
* gtk/gtktextchild.c:
* gtk/gtktextbtree.c:
* gtk/gtktextmark.c:
* gtk/gtktexttypes.h: Make the segment class pointers const.
* gtk/gtktextbufferserialize.c: Make parser struct const.
* gtk/gtkuimanager.c: Make parser struct const.
2006-04-03 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtktextlayout.c: Fix a warning.
+
+ * gtk/gtktextsegment.h:
+ * gtk/gtktextsegment.c:
+ * gtk/gtktextmark.c:
+ * gtk/gtktexttypes.h: Make the segment class pointers const.
+
+ * gtk/gtktextbufferserialize.c: Make parser struct const.
+
+ * gtk/gtkuimanager.c: Make parser struct const.
+
* gtk/gtklinkbutton.c: Make the default colors const.
* gtk/gtkuimanager.c: Avoid relocations.
2006-04-03 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtktextlayout.c: Fix a warning.
+
+ * gtk/gtktextsegment.h:
+ * gtk/gtktextsegment.c:
+ * gtk/gtktextmark.c:
+ * gtk/gtktexttypes.h: Make the segment class pointers const.
+
+ * gtk/gtktextbufferserialize.c: Make parser struct const.
+
+ * gtk/gtkuimanager.c: Make parser struct const.
+
* gtk/gtklinkbutton.c: Make the default colors const.
* gtk/gtkuimanager.c: Avoid relocations.
}
else
{
- GtkTextLineSegmentClass * last = NULL;
+ const GtkTextLineSegmentClass *last = NULL;
for (line = node->children.line ; line != NULL ;
line = line->next)
ParseInfo info;
gboolean retval = FALSE;
-
- static GMarkupParser rich_text_parser = {
+ static const GMarkupParser rich_text_parser = {
start_element_handler,
end_element_handler,
text_handler,
}
-GtkTextLineSegmentClass gtk_text_pixbuf_type = {
+const GtkTextLineSegmentClass gtk_text_pixbuf_type = {
"pixbuf", /* name */
FALSE, /* leftGravity */
NULL, /* splitFunc */
g_error ("child segment has char count of %d", seg->char_count);
}
-GtkTextLineSegmentClass gtk_text_child_type = {
+const GtkTextLineSegmentClass gtk_text_child_type = {
"child-widget", /* name */
FALSE, /* leftGravity */
NULL, /* splitFunc */
pango_layout_set_width (display->layout, layout_width * PANGO_SCALE);
pango_layout_set_wrap (display->layout, PANGO_WRAP_CHAR);
break;
-
case GTK_WRAP_WORD:
layout_width = layout->screen_width - display->left_margin - display->right_margin;
pango_layout_set_width (display->layout, layout_width * PANGO_SCALE);
static void
gtk_text_attr_appearance_destroy (PangoAttribute *attr)
{
- GtkTextAppearance *appearance = &((GtkTextAttrAppearance *)attr)->appearance;
+ GtkTextAttrAppearance *appearance_attr = (GtkTextAttrAppearance *)attr;
- if (appearance->bg_stipple)
- g_object_unref (appearance->bg_stipple);
- if (appearance->fg_stipple)
- g_object_unref (appearance->fg_stipple);
+ if (appearance_attr->appearance.bg_stipple)
+ g_object_unref (appearance_attr->appearance.bg_stipple);
+ if (appearance_attr->appearance.fg_stipple)
+ g_object_unref (appearance_attr->appearance.fg_stipple);
- g_slice_free (GtkTextAttrAppearance, attr);
+ g_slice_free (GtkTextAttrAppearance, appearance_attr);
}
static gboolean
* their gravity property.
*/
-GtkTextLineSegmentClass gtk_text_right_mark_type = {
+const GtkTextLineSegmentClass gtk_text_right_mark_type = {
"mark", /* name */
FALSE, /* leftGravity */
NULL, /* splitFunc */
mark_segment_check_func /* checkFunc */
};
-GtkTextLineSegmentClass gtk_text_left_mark_type = {
+const GtkTextLineSegmentClass gtk_text_left_mark_type = {
"mark", /* name */
TRUE, /* leftGravity */
NULL, /* splitFunc */
g_assert (gtk_text_byte_begins_utf8_char (text));
seg = g_malloc (CSEG_SIZE (len));
- seg->type = >k_text_char_type;
+ seg->type = (GtkTextLineSegmentClass *)>k_text_char_type;
seg->next = NULL;
seg->byte_count = len;
memcpy (seg->body.chars, text, len);
*/
-GtkTextLineSegmentClass gtk_text_char_type = {
+const GtkTextLineSegmentClass gtk_text_char_type = {
"character", /* name */
0, /* leftGravity */
char_segment_split_func, /* splitFunc */
* range:
*/
-GtkTextLineSegmentClass gtk_text_toggle_on_type = {
+const GtkTextLineSegmentClass gtk_text_toggle_on_type = {
"toggleOn", /* name */
0, /* leftGravity */
NULL, /* splitFunc */
* range:
*/
-GtkTextLineSegmentClass gtk_text_toggle_off_type = {
+const GtkTextLineSegmentClass gtk_text_toggle_off_type = {
"toggleOff", /* name */
1, /* leftGravity */
NULL, /* splitFunc */
*/
struct _GtkTextLineSegment {
- GtkTextLineSegmentClass *type; /* Pointer to record describing
- * segment's type. */
- GtkTextLineSegment *next; /* Next in list of segments for this
- * line, or NULL for end of list. */
+ const GtkTextLineSegmentClass *type; /* Pointer to record describing
+ * segment's type. */
+ GtkTextLineSegment *next; /* Next in list of segments for this
+ * line, or NULL for end of list. */
int char_count; /* # of chars of index space occupied */
#endif
/* In gtktextbtree.c */
-extern GtkTextLineSegmentClass gtk_text_char_type;
-extern GtkTextLineSegmentClass gtk_text_toggle_on_type;
-extern GtkTextLineSegmentClass gtk_text_toggle_off_type;
+extern const GtkTextLineSegmentClass gtk_text_char_type;
+extern const GtkTextLineSegmentClass gtk_text_toggle_on_type;
+extern const GtkTextLineSegmentClass gtk_text_toggle_off_type;
/* In gtktextmark.c */
-extern GtkTextLineSegmentClass gtk_text_left_mark_type;
-extern GtkTextLineSegmentClass gtk_text_right_mark_type;
+extern const GtkTextLineSegmentClass gtk_text_left_mark_type;
+extern const GtkTextLineSegmentClass gtk_text_right_mark_type;
/* In gtktextchild.c */
-extern GtkTextLineSegmentClass gtk_text_pixbuf_type;
-extern GtkTextLineSegmentClass gtk_text_child_type;
+extern const GtkTextLineSegmentClass gtk_text_pixbuf_type;
+extern const GtkTextLineSegmentClass gtk_text_child_type;
/*
* UTF 8 Stubs
}
-static GMarkupParser ui_parser = {
+static const GMarkupParser ui_parser = {
start_element_handler,
end_element_handler,
text_handler,